Conversation
tcharding
left a comment
There was a problem hiding this comment.
My review is not super deep in line with my knowledge of the codebase but here are a few minor suggestions for you.
Thanks
I've been thinking about this a bit but I don't really have decent any suggestions. I guess you could make I gave this a quick look this morning and to be honest I couldn't really find any issues. I'll give it a more in-depth review now but I'm not expecting to find anything major, so we might be on track to merge this today/tomorrow just in time for the feature freeze. |
Let me elaborate on the difficulty I had because it's not fundamental. I tried to add a function to wallet like The only problem was dealing with To work around this I thought there could be a private enum type in So in the end I think we shouldn't try and normalize foreign and local utxos into the same type per-maturlely and that an enum is the right way to go. Hopefully that makes sense. |
|
I addressed comments so far and pushed a commit to improve the test code a bit. Now clippy is upset at me for I didn't write. Help! |
I have #282 to fix the clippy errors, they're caused by the Rust |
|
Sorry this needs to be rebased again to pick up the PR that just went in to change the CI pipeline from |
8ae3100 to
899fe58
Compare
|
The build is failing because some rust infra is down -- will try again tomorrow. |
899fe58 to
ad090db
Compare
Since this struct has a "keychain" it is not a general "UTXO" but a local wallet UTXO.
it derived Clone but in practice it was never clone because some of the parameters were not Clone.
To allow adding UTXOs external to the current wallet. The caller must provide the psbt::Input so we can create a coherent PSBT at the end and so this is compatible with existing PSBT workflows. Main changes: - There are now two types of UTXOs, local and foreign reflected in a `Utxo` enum. - `WeightedUtxo` now captures floating `(Utxo, usize)` tuples - `CoinSelectionResult` now has methods on it for distinguishing between local amount included vs total.
Co-authored-by: Tobin C. Harding <me@tobin.cc>
Noticed some suboptimal things while reviewing myself.
ad090db to
ac7c1bd
Compare
Description
Fixes #114
This adds a method to
TxBuildercalledadd_foreign_utxowhich takes an outpoint, apsbt::Inputand a satisfaction weight.I decided taking a
psbt::Inputwas the most flexible way to proceed and this seems to be the most compatible way of implementing BIP78 (well technicallyadd_psbtwould be closer to what they're going for -- this could be done more easily after this PR).Misc changes
UTXOhas been renamed toLocalUtxo.TxBuilderwasn't properlyClonebefore. I've fixed this and used it in a test.(UTXO, usize)has been replaced withWeightedUtxo-- no particular motivation it was just annoying me.Notes to the reviewers
Utxoas an enum with two variants but normalizing both foreign and local utxos into the same struct seemed to be more complicated.Checklists
cargo fmtandcargo clippybefore committingCHANGELOG.md